package Wires.diagram.part;

import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Map;

import org.eclipse.gmf.runtime.diagram.core.services.ViewService;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.Node;
import org.eclipse.gmf.runtime.notation.View;

/**
 * @generated
 */
public class WiresDiagramContentInitializer {

	/**
	 * @generated
	 */
	private Map myDomain2NotationMap = new HashMap();

	/**
	 * @generated
	 */
	private Collection myLinkDescriptors = new LinkedList();

	/**
	 * @generated
	 */
	public void initDiagramContent(Diagram diagram) {
		if (!Wires.diagram.edit.parts.WiresSpecificationEditPart.MODEL_ID
				.equals(diagram.getType())) {
			Wires.diagram.part.WiresDiagramEditorPlugin.getInstance().logError(
					"Incorrect diagram passed as a parameter: "
							+ diagram.getType());
			return;
		}
		if (false == diagram.getElement() instanceof Wires.WiresSpecification) {
			Wires.diagram.part.WiresDiagramEditorPlugin.getInstance().logError(
					"Incorrect diagram element specified: "
							+ diagram.getElement()
							+ " instead of WiresSpecification");
			return;
		}
		createWiresSpecification_79Children(diagram);
		createLinks(diagram);
	}

	/**
	 * @generated
	 */
	private void createAtomicModelTransformation_1001Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getAtomicModelTransformation_1001OutgoingLinks(view));
		Collection childNodeDescriptors = Wires.diagram.part.WiresDiagramUpdater
				.getAtomicModelTransformation_1001SemanticChildren(view);
		for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
			createNode(view, (Wires.diagram.part.WiresNodeDescriptor) it.next());
		}

	}

	/**
	 * @generated
	 */
	private void createIdentityTransformation_1002Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getIdentityTransformation_1002OutgoingLinks(view));
		Collection childNodeDescriptors = Wires.diagram.part.WiresDiagramUpdater
				.getIdentityTransformation_1002SemanticChildren(view);
		for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
			createNode(view, (Wires.diagram.part.WiresNodeDescriptor) it.next());
		}

	}

	/**
	 * @generated
	 */
	private void createGenericTransformation_1003Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getGenericTransformation_1003OutgoingLinks(view));
		Collection childNodeDescriptors = Wires.diagram.part.WiresDiagramUpdater
				.getGenericTransformation_1003SemanticChildren(view);
		for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
			createNode(view, (Wires.diagram.part.WiresNodeDescriptor) it.next());
		}

	}

	/**
	 * @generated
	 */
	private void createCompositeTransformation_1004Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getCompositeTransformation_1004OutgoingLinks(view));
		Collection childNodeDescriptors = Wires.diagram.part.WiresDiagramUpdater
				.getCompositeTransformation_1004SemanticChildren(view);
		for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
			createNode(view, (Wires.diagram.part.WiresNodeDescriptor) it.next());
		}

	}

	/**
	 * @generated
	 */
	private void createModel2TextTransformation_1005Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getModel2TextTransformation_1005OutgoingLinks(view));
		Collection childNodeDescriptors = Wires.diagram.part.WiresDiagramUpdater
				.getModel2TextTransformation_1005SemanticChildren(view);
		for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
			createNode(view, (Wires.diagram.part.WiresNodeDescriptor) it.next());
		}

	}

	/**
	 * @generated
	 */
	private void createQuery_1006Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getQuery_1006OutgoingLinks(view));
		Collection childNodeDescriptors = Wires.diagram.part.WiresDiagramUpdater
				.getQuery_1006SemanticChildren(view);
		for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
			createNode(view, (Wires.diagram.part.WiresNodeDescriptor) it.next());
		}

	}

	/**
	 * @generated
	 */
	private void createBasicData_1007Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getBasicData_1007OutgoingLinks(view));

	}

	/**
	 * @generated
	 */
	private void createModel_1008Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getModel_1008OutgoingLinks(view));

	}

	/**
	 * @generated
	 */
	private void createModelType_1009Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getModelType_1009OutgoingLinks(view));

	}

	/**
	 * @generated
	 */
	private void createDecisionNode_1010Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getDecisionNode_1010OutgoingLinks(view));
		Collection childNodeDescriptors = Wires.diagram.part.WiresDiagramUpdater
				.getDecisionNode_1010SemanticChildren(view);
		for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
			createNode(view, (Wires.diagram.part.WiresNodeDescriptor) it.next());
		}

	}

	/**
	 * @generated
	 */
	private void createLibrary_1011Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getLibrary_1011OutgoingLinks(view));
		Collection childNodeDescriptors = Wires.diagram.part.WiresDiagramUpdater
				.getLibrary_1011SemanticChildren(view);
		for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
			createNode(view, (Wires.diagram.part.WiresNodeDescriptor) it.next());
		}

	}

	/**
	 * @generated
	 */
	private void createAtomicModelTransfomationType_1012Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getAtomicModelTransfomationType_1012OutgoingLinks(view));
		Collection childNodeDescriptors = Wires.diagram.part.WiresDiagramUpdater
				.getAtomicModelTransfomationType_1012SemanticChildren(view);
		for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
			createNode(view, (Wires.diagram.part.WiresNodeDescriptor) it.next());
		}

	}

	/**
	 * @generated
	 */
	private void createModel2TextTransformationType_1013Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getModel2TextTransformationType_1013OutgoingLinks(view));
		Collection childNodeDescriptors = Wires.diagram.part.WiresDiagramUpdater
				.getModel2TextTransformationType_1013SemanticChildren(view);
		for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
			createNode(view, (Wires.diagram.part.WiresNodeDescriptor) it.next());
		}

	}

	/**
	 * @generated
	 */
	private void createQueryType_1014Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getQueryType_1014OutgoingLinks(view));
		Collection childNodeDescriptors = Wires.diagram.part.WiresDiagramUpdater
				.getQueryType_1014SemanticChildren(view);
		for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
			createNode(view, (Wires.diagram.part.WiresNodeDescriptor) it.next());
		}

	}

	/**
	 * @generated
	 */
	private void createCompositeTransformationType_1015Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getCompositeTransformationType_1015OutgoingLinks(view));
		Collection childNodeDescriptors = Wires.diagram.part.WiresDiagramUpdater
				.getCompositeTransformationType_1015SemanticChildren(view);
		for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
			createNode(view, (Wires.diagram.part.WiresNodeDescriptor) it.next());
		}
		createCompositeTransformationTypeCompositeTransformationTypeEls_5001Children(getCompartment(
				view,
				Wires.diagram.edit.parts.CompositeTransformationTypeCompositeTransformationTypeElsEditPart.VISUAL_ID));

	}

	/**
	 * @generated
	 */
	private void createInputActualParameter_2001Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getInputActualParameter_2001OutgoingLinks(view));

	}

	/**
	 * @generated
	 */
	private void createOutputActualParameter_2002Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getOutputActualParameter_2002OutgoingLinks(view));

	}

	/**
	 * @generated
	 */
	private void createTypeParameter_2003Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getTypeParameter_2003OutgoingLinks(view));

	}

	/**
	 * @generated
	 */
	private void createInputActualParameter_2004Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getInputActualParameter_2004OutgoingLinks(view));

	}

	/**
	 * @generated
	 */
	private void createLibraryRef_2005Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getLibraryRef_2005OutgoingLinks(view));

	}

	/**
	 * @generated
	 */
	private void createInputFormalParameter_2006Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getInputFormalParameter_2006OutgoingLinks(view));

	}

	/**
	 * @generated
	 */
	private void createOutputFormalParameter_2007Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getOutputFormalParameter_2007OutgoingLinks(view));

	}

	/**
	 * @generated
	 */
	private void createLibraryRef_2008Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getLibraryRef_2008OutgoingLinks(view));

	}

	/**
	 * @generated
	 */
	private void createModel_2009Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getModel_2009OutgoingLinks(view));

	}

	/**
	 * @generated
	 */
	private void createBasicData_2010Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getBasicData_2010OutgoingLinks(view));

	}

	/**
	 * @generated
	 */
	private void createCompositeTransformation_2011Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getCompositeTransformation_2011OutgoingLinks(view));
		Collection childNodeDescriptors = Wires.diagram.part.WiresDiagramUpdater
				.getCompositeTransformation_2011SemanticChildren(view);
		for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
			createNode(view, (Wires.diagram.part.WiresNodeDescriptor) it.next());
		}

	}

	/**
	 * @generated
	 */
	private void createAtomicModelTransformation_2012Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getAtomicModelTransformation_2012OutgoingLinks(view));
		Collection childNodeDescriptors = Wires.diagram.part.WiresDiagramUpdater
				.getAtomicModelTransformation_2012SemanticChildren(view);
		for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
			createNode(view, (Wires.diagram.part.WiresNodeDescriptor) it.next());
		}

	}

	/**
	 * @generated
	 */
	private void createGenericTransformation_2013Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getGenericTransformation_2013OutgoingLinks(view));
		Collection childNodeDescriptors = Wires.diagram.part.WiresDiagramUpdater
				.getGenericTransformation_2013SemanticChildren(view);
		for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
			createNode(view, (Wires.diagram.part.WiresNodeDescriptor) it.next());
		}

	}

	/**
	 * @generated
	 */
	private void createIdentityTransformation_2014Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getIdentityTransformation_2014OutgoingLinks(view));
		Collection childNodeDescriptors = Wires.diagram.part.WiresDiagramUpdater
				.getIdentityTransformation_2014SemanticChildren(view);
		for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
			createNode(view, (Wires.diagram.part.WiresNodeDescriptor) it.next());
		}

	}

	/**
	 * @generated
	 */
	private void createQuery_2015Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getQuery_2015OutgoingLinks(view));
		Collection childNodeDescriptors = Wires.diagram.part.WiresDiagramUpdater
				.getQuery_2015SemanticChildren(view);
		for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
			createNode(view, (Wires.diagram.part.WiresNodeDescriptor) it.next());
		}

	}

	/**
	 * @generated
	 */
	private void createDecisionNode_2016Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getDecisionNode_2016OutgoingLinks(view));
		Collection childNodeDescriptors = Wires.diagram.part.WiresDiagramUpdater
				.getDecisionNode_2016SemanticChildren(view);
		for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
			createNode(view, (Wires.diagram.part.WiresNodeDescriptor) it.next());
		}

	}

	/**
	 * @generated
	 */
	private void createModel2TextTransformation_2017Children(View view) {
		myDomain2NotationMap.put(view.getElement(), view);
		myLinkDescriptors.addAll(Wires.diagram.part.WiresDiagramUpdater
				.getModel2TextTransformation_2017OutgoingLinks(view));
		Collection childNodeDescriptors = Wires.diagram.part.WiresDiagramUpdater
				.getModel2TextTransformation_2017SemanticChildren(view);
		for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
			createNode(view, (Wires.diagram.part.WiresNodeDescriptor) it.next());
		}

	}

	/**
	 * @generated
	 */
	private void createCompositeTransformationTypeCompositeTransformationTypeEls_5001Children(
			View view) {
		Collection childNodeDescriptors = Wires.diagram.part.WiresDiagramUpdater
				.getCompositeTransformationTypeCompositeTransformationTypeEls_5001SemanticChildren(view);
		for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
			createNode(view, (Wires.diagram.part.WiresNodeDescriptor) it.next());
		}
	}

	/**
	 * @generated
	 */
	private void createWiresSpecification_79Children(View view) {
		Collection childNodeDescriptors = Wires.diagram.part.WiresDiagramUpdater
				.getWiresSpecification_79SemanticChildren(view);
		for (Iterator it = childNodeDescriptors.iterator(); it.hasNext();) {
			createNode(view, (Wires.diagram.part.WiresNodeDescriptor) it.next());
		}
	}

	/**
	 * @generated
	 */
	private void createNode(View parentView,
			Wires.diagram.part.WiresNodeDescriptor nodeDescriptor) {
		Node node = ViewService
				.createNode(
						parentView,
						nodeDescriptor.getModelElement(),
						nodeDescriptor.getType(),
						Wires.diagram.part.WiresDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
		switch (nodeDescriptor.getVisualID()) {
		case Wires.diagram.edit.parts.AtomicModelTransformationEditPart.VISUAL_ID:
			createAtomicModelTransformation_1001Children(node);
			return;
		case Wires.diagram.edit.parts.IdentityTransformationEditPart.VISUAL_ID:
			createIdentityTransformation_1002Children(node);
			return;
		case Wires.diagram.edit.parts.GenericTransformationEditPart.VISUAL_ID:
			createGenericTransformation_1003Children(node);
			return;
		case Wires.diagram.edit.parts.CompositeTransformationEditPart.VISUAL_ID:
			createCompositeTransformation_1004Children(node);
			return;
		case Wires.diagram.edit.parts.Model2TextTransformationEditPart.VISUAL_ID:
			createModel2TextTransformation_1005Children(node);
			return;
		case Wires.diagram.edit.parts.QueryEditPart.VISUAL_ID:
			createQuery_1006Children(node);
			return;
		case Wires.diagram.edit.parts.BasicDataEditPart.VISUAL_ID:
			createBasicData_1007Children(node);
			return;
		case Wires.diagram.edit.parts.ModelEditPart.VISUAL_ID:
			createModel_1008Children(node);
			return;
		case Wires.diagram.edit.parts.ModelTypeEditPart.VISUAL_ID:
			createModelType_1009Children(node);
			return;
		case Wires.diagram.edit.parts.DecisionNodeEditPart.VISUAL_ID:
			createDecisionNode_1010Children(node);
			return;
		case Wires.diagram.edit.parts.LibraryEditPart.VISUAL_ID:
			createLibrary_1011Children(node);
			return;
		case Wires.diagram.edit.parts.AtomicModelTransfomationTypeEditPart.VISUAL_ID:
			createAtomicModelTransfomationType_1012Children(node);
			return;
		case Wires.diagram.edit.parts.Model2TextTransformationTypeEditPart.VISUAL_ID:
			createModel2TextTransformationType_1013Children(node);
			return;
		case Wires.diagram.edit.parts.QueryTypeEditPart.VISUAL_ID:
			createQueryType_1014Children(node);
			return;
		case Wires.diagram.edit.parts.CompositeTransformationTypeEditPart.VISUAL_ID:
			createCompositeTransformationType_1015Children(node);
			return;
		case Wires.diagram.edit.parts.InputActualParameterEditPart.VISUAL_ID:
			createInputActualParameter_2001Children(node);
			return;
		case Wires.diagram.edit.parts.OutputActualParameterEditPart.VISUAL_ID:
			createOutputActualParameter_2002Children(node);
			return;
		case Wires.diagram.edit.parts.TypeParameterEditPart.VISUAL_ID:
			createTypeParameter_2003Children(node);
			return;
		case Wires.diagram.edit.parts.InputActualParameter2EditPart.VISUAL_ID:
			createInputActualParameter_2004Children(node);
			return;
		case Wires.diagram.edit.parts.LibraryRefEditPart.VISUAL_ID:
			createLibraryRef_2005Children(node);
			return;
		case Wires.diagram.edit.parts.InputFormalParameterEditPart.VISUAL_ID:
			createInputFormalParameter_2006Children(node);
			return;
		case Wires.diagram.edit.parts.OutputFormalParameterEditPart.VISUAL_ID:
			createOutputFormalParameter_2007Children(node);
			return;
		case Wires.diagram.edit.parts.LibraryRef2EditPart.VISUAL_ID:
			createLibraryRef_2008Children(node);
			return;
		case Wires.diagram.edit.parts.Model2EditPart.VISUAL_ID:
			createModel_2009Children(node);
			return;
		case Wires.diagram.edit.parts.BasicData2EditPart.VISUAL_ID:
			createBasicData_2010Children(node);
			return;
		case Wires.diagram.edit.parts.CompositeTransformation2EditPart.VISUAL_ID:
			createCompositeTransformation_2011Children(node);
			return;
		case Wires.diagram.edit.parts.AtomicModelTransformation2EditPart.VISUAL_ID:
			createAtomicModelTransformation_2012Children(node);
			return;
		case Wires.diagram.edit.parts.GenericTransformation2EditPart.VISUAL_ID:
			createGenericTransformation_2013Children(node);
			return;
		case Wires.diagram.edit.parts.IdentityTransformation2EditPart.VISUAL_ID:
			createIdentityTransformation_2014Children(node);
			return;
		case Wires.diagram.edit.parts.Query2EditPart.VISUAL_ID:
			createQuery_2015Children(node);
			return;
		case Wires.diagram.edit.parts.DecisionNode2EditPart.VISUAL_ID:
			createDecisionNode_2016Children(node);
			return;
		case Wires.diagram.edit.parts.Model2TextTransformation2EditPart.VISUAL_ID:
			createModel2TextTransformation_2017Children(node);
			return;
		}
	}

	/**
	 * @generated
	 */
	private void createLinks(Diagram diagram) {
		for (boolean continueLinkCreation = true; continueLinkCreation;) {
			continueLinkCreation = false;
			Collection additionalDescriptors = new LinkedList();
			for (Iterator it = myLinkDescriptors.iterator(); it.hasNext();) {
				Wires.diagram.part.WiresLinkDescriptor nextLinkDescriptor = (Wires.diagram.part.WiresLinkDescriptor) it
						.next();
				if (!myDomain2NotationMap.containsKey(nextLinkDescriptor
						.getSource())
						|| !myDomain2NotationMap.containsKey(nextLinkDescriptor
								.getDestination())) {
					continue;
				}
				Edge edge = (Edge) ViewService
						.getInstance()
						.createEdge(
								nextLinkDescriptor.getSemanticAdapter(),
								diagram,
								nextLinkDescriptor.getType(),
								ViewUtil.APPEND,
								Wires.diagram.part.WiresDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT);
				if (edge != null) {
					edge.setSource((View) myDomain2NotationMap
							.get(nextLinkDescriptor.getSource()));
					edge.setTarget((View) myDomain2NotationMap
							.get(nextLinkDescriptor.getDestination()));
					it.remove();
					if (nextLinkDescriptor.getModelElement() != null) {
						myDomain2NotationMap.put(nextLinkDescriptor
								.getModelElement(), edge);
					}
					continueLinkCreation = true;
					switch (nextLinkDescriptor.getVisualID()) {
					case Wires.diagram.edit.parts.DataFlowEditPart.VISUAL_ID:
						additionalDescriptors
								.addAll(Wires.diagram.part.WiresDiagramUpdater
										.getDataFlow_3001OutgoingLinks(edge));
						break;
					}
				}
			}
			myLinkDescriptors.addAll(additionalDescriptors);
		}
	}

	/**
	 * @generated
	 */
	private Node getCompartment(View node, int visualID) {
		String type = Wires.diagram.part.WiresVisualIDRegistry
				.getType(visualID);
		for (Iterator it = node.getChildren().iterator(); it.hasNext();) {
			View nextView = (View) it.next();
			if (nextView instanceof Node && type.equals(nextView.getType())) {
				return (Node) nextView;
			}
		}
		return null;
	}

}
